﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WebServerX.Logging;
using System.IO;

namespace WebServerX.Console
{
    class Program
    {
        static void Main(string[] args)
        {
            Logger.OutStream = System.Console.OpenStandardOutput();

            Logger.Log("System Started");

            Server server = new Server();

            server.Init();

            server.Run();

            while (server.IsRunning)
            {
                if (System.Console.KeyAvailable)
                {
                    server.Stop();
                    break;
                }
            }

            server.Shutdown();

            Logger.Log("System Exited");
        }
    }
}
